use cargo::util::{process,ProcessBuilder};
use cargo::util::ProcessError;
+use support::paths::PathExt;
+
pub mod paths;
/*
try!(mkdir_recursive(&self.root));
for file in self.files.iter() {
- try!(file.mk());
+ try!(file.mk());
}
Ok(())
fn rm_root(&self) -> Result<(), String> {
if self.root.exists() {
rmdir_recursive(&self.root)
- }
- else {
+ } else {
Ok(())
}
}
}
pub fn rmdir_recursive(path: &Path) -> Result<(), String> {
- fs::rmdir_recursive(path)
+ path.rm_rf()
.with_err_msg(format!("could not rm directory; path={}",
path.display()))
}
-use support::{project, execs, basic_bin_manifest, COMPILING};
+use support::{project, execs, basic_bin_manifest, COMPILING, cargo_dir};
use hamcrest::{assert_that, existing_file};
use cargo::util::process;
process(p.bin("foo")),
execs().with_stdout("hello\n"));
- assert_that(p.cargo_process("cargo-test"),
+ assert_that(p.process(cargo_dir().join("cargo-test")),
execs().with_stdout(format!("{} foo v0.5.0 (file:{})\n\n\
running 1 test\n\
test test_hello ... ok\n\n\
test result: ok. 1 passed; 0 failed; \
0 ignored; 0 measured\n\n",
COMPILING, p.root().display())));
-
+
assert_that(&p.bin("tests/foo"), existing_file());
})